import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
	path: '/',
	name: 'Home',
	component: Home,
	redirect: '/all',
	children: [{
			path: '/all',
			name: 'all',
			component: () => import('../views/all')
		},
		{
			path: '/yz',
			name: 'yz',
			component: () => import('../views/yz')
		},
		{
			path: '/LOL',
			name: 'LOL',
			component: () => import('../views/LOL')
		},
		{
			path: '/wzry',
			name: 'wzry',
			component: () => import('../views/wzry')
		},
		{
			path: '/jdqs',
			name: 'jdqs',
			component: () => import('../views/jdqs')
		},
		{
			path: '/CFSY',
			name: 'CFSY',
			component: () => import('../views/cf')
		},
		{
			path: '/DOTA2',
			name: 'DOTA2',
			component: () => import('../views/dota')
		},
		{
			path: '/DNF',
			name: 'DNF',
			component: () => import('../views/DNF')
		},
		{
			path: '/hpjy',
			name: 'hpjy',
			component: () => import('../views/hpjy')
		},
		{
			path: '/hw',
			name: 'hw',
			component: () => import('../views/hw')
		},
		{
			path: '/yqk',
			name: 'yqk',
			component: () => import('../views/yqk')
		},
		{
			path: '/ecy',
			name: 'ecy',
			component: () => import('../views/ecy')
		},
		{
			path: '/allHot',
			name: 'allHot',
			component: () => import('../views/zhibo')
		}
	]
}, ]

const router = new VueRouter({
	routes
})

const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	if (typeof(location) == "string") {
		var Separator = "&";
		if (location.indexOf('?') == -1) {
			Separator = '?';
		}
		location = location + Separator + "random=" + Math.random();
	}
	return routerPush.call(this, location).catch(error => error)
}



export default router
